package cn.IT.domain;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.struts2.json.annotations.JSONFieldBridge;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Like entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "like", catalog = "itsupport")
@JsonIgnoreProperties(value = {"reply"})
public class Like implements java.io.Serializable {

	// Fields

	private Integer likeId;
	private User user;
	private Reply reply;

	// Constructors

	/** default constructor */
	public Like() {
	}

	/** full constructor */
	public Like(Integer likeId, User user, Reply reply) {
		this.likeId = likeId;
		this.user = user;
		this.reply = reply;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "likeId", unique = true, nullable = false)
	public Integer getLikeId() {
		return this.likeId;
	}

	public void setLikeId(Integer likeId) {
		this.likeId = likeId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "userId", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "replyId", nullable = false)
	public Reply getReply() {
		return this.reply;
	}

	public void setReply(Reply reply) {
		this.reply = reply;
	}

}